package com.ltmonitor.service.impl;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ltmonitor.dao.IMediaItemDao;
import com.ltmonitor.entity.MediaItem;
import com.ltmonitor.service.IMediaItemService;

@Service("mediaItemService")
public class MediaItemService extends BaseService<Long, MediaItem> implements IMediaItemService {

	@Autowired
	private IMediaItemDao MediaItemDao;
	/**
	 * 
	 * @param commandId 用户下发指令后，数据库自动生成的命令记录的主键ID
	 * @return MediaItem 下方拍照或录音、
	 */
	public MediaItem getMediaItemByCommandId(long commandId)
	{
		String hsql = "from MediaItem where commandId = ?";
		MediaItem mi = (MediaItem) this.find(hsql,
				commandId);
		return mi;
	}
	
	public List<MediaItem> queryMediaItemListByCommandId(long commandId)
	{
		String hsql = "from MediaItem where commandId = ?";
		return this.query(hsql,
				commandId);
	}
	

}
